<template>
  <el-form ref="refFrom" label-position="top" class="padding">
    <el-row>
      <el-col :span="6">
        <el-form-item label="订单号">
          {{currentItem.orderId}}
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="使用时长(秒)"> {{currentItem.chooseTime}} </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="设备名称">{{currentItem.deviceId}}</el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="设备类型">
          {{$common.marchType(currentItem.orderType,dict.order_type)}}
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="6">
        <el-form-item label="开始时间">
          {{currentItem.openTime}}
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="结束时间">
          {{currentItem.closeTime}}
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
  <div class="tabel-container myTable">
    <vxe-table ref="tableRef" :data="currentItem.executions" v-loading="loading">
      <vxe-table-column :resizable="true" type="seq" title="序号" width="80" sortable></vxe-table-column>
      <vxe-table-column :resizable="true" field="startTime" title="开始供氧时间" sortable> </vxe-table-column>
      <vxe-table-column :resizable="true" field="endTime" title="结束供氧时间" sortable> </vxe-table-column>
      <vxe-table-column :resizable="true" field="useTime" title="供氧时长(秒)" sortable> </vxe-table-column>
    </vxe-table>
  </div>
</template>

<script lang="ts">
export default {
  mounted() {
    const { proxy } = getCurrentInstance() as ComponentInternalInstance;
    this.proxy = proxy;

    this.dict = toRefs<any>(this.proxy?.useDict('order_type'));

    this.init();
  },
  props: {
    data: {}
  },
  data() {
    return {
      dict: {},
      proxy: null,
      currentItem: {
        executions: []
      }
    };
  },
  created() {},
  methods: {
    init(data) {
      if (data == null) data = this.data;
      this.currentItem = data;
    }
  }
};
</script>

<style scoped>
.padding {
  padding: 0px;
}
</style>
